import 'package:flutter/material.dart';

import '../../pojo/vo/WordBookVo.dart';

class BookInfoCard extends StatelessWidget {
  const BookInfoCard({super.key, required this.bookVo});

  final WordBookVo bookVo;

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: 170,
      width: double.infinity,
      child: Card(
          color: Theme.of(context).colorScheme.primaryContainer,
          elevation: 4,
          child: Padding(
              padding: const EdgeInsets.all(15),
              child: Column(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Text(   // 词书名
                          "${bookVo.name}",
                          style: TextStyle(
                              fontSize: 20,
                              color: Theme.of(context).colorScheme.onSecondary,
                              fontWeight: FontWeight.bold
                          ),
                        ),
                        Text(  // 词书描述
                          "-${bookVo.description}",
                          style: TextStyle(
                            fontSize: 14,
                            color: Theme.of(context).colorScheme.onSecondary,
                          ),
                        ),
                        Text(
                          "-总词汇量：${bookVo.wordCount}",
                          style: TextStyle(
                            fontSize: 14,
                            color: Theme.of(context).colorScheme.onSecondary,
                          ),
                        ),
                      ],
                    ),
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        const SizedBox(),
                        Text(
                          "${bookVo.id}",
                          style: TextStyle(
                            fontSize: 10,
                            color: Theme.of(context).colorScheme.onSecondary,
                          ),
                        ),
                      ],
                    )
                  ]
              )
          )
      ),
    );
  }
}
